export const beforSubmit = (data: any, that: any) => {
  // 开票信息
  if(that.typeId === '3b0df27f-9254-4ed6-857f-71df8e3a725f'){
    if(that.dyFormData && that.dyFormData.id){
      data.id = that.dyFormData.id
    }
    if(that.pageType){
      data.businessType = that.pageType
    }
  }
  // 联系人
  if(that.typeId === '509ba753-e5da-4db4-8908-c12b54f21a31'){
    data.operateCode = that.pageType
    console.log(data.operateCode)
  }
  // 抄表到户资料填报
  if(that.typeId === 'd399f189-7043-4d34-9838-cfda41836f5e'){
    data.businessType = '1'
  }
  // 抄表到户申请
  if(data.typeId === 'a59e4bd4-8386-4e16-a3cf-ee544fe1d655'){
    data.businessType = '0'
  }

  if(data.typeId === '13'){
    let DN = ''
    Object.keys(data).forEach(key => {
      if(key.indexOf('DN') > -1){
        if(DN){
          DN = `${DN}|${key},${data[key]}`
        }else{
          DN = `${key},${data[key]}`
        }
      }
    })

    data.DN = DN
  }

  return data
}
